<div class="blazorise-codeblock">
<div class="html"><pre>
<span class="htmlTagDelimiter">&lt;</span><span class="htmlElementName">Field</span><span class="htmlTagDelimiter">&gt;</span>
    <span class="htmlTagDelimiter">&lt;</span><span class="htmlElementName">FileEdit</span> <span class="htmlAttributeName">Multiple</span><span class="htmlOperator">=</span><span class="quot">&quot;</span><span class="keyword">false</span><span class="quot">&quot;</span> <span class="htmlTagDelimiter">/&gt;</span>
    <span class="htmlTagDelimiter">&lt;</span><span class="htmlElementName">FileEdit</span> <span class="htmlAttributeName">Multiple</span> <span class="htmlTagDelimiter">/&gt;</span>
<span class="htmlTagDelimiter">&lt;/</span><span class="htmlElementName">Field</span><span class="htmlTagDelimiter">&gt;</span>
<span class="htmlTagDelimiter">&lt;</span><span class="htmlElementName">Field</span><span class="htmlTagDelimiter">&gt;</span>
    <span class="htmlTagDelimiter">&lt;</span><span class="htmlElementName">Button</span> <span class="htmlAttributeName">Clicked</span><span class="htmlOperator">=</span><span class="quot">&quot;</span><span class="htmlAttributeValue">OnButtonClick</span><span class="quot">&quot;</span><span class="htmlTagDelimiter">&gt;</span>Change culture to polish<span class="htmlTagDelimiter">&lt;/</span><span class="htmlElementName">Button</span><span class="htmlTagDelimiter">&gt;</span>
<span class="htmlTagDelimiter">&lt;/</span><span class="htmlElementName">Field</span><span class="htmlTagDelimiter">&gt;</span>
</pre></div>
<div class="csharp"><pre>
<span class="atSign">&#64;</span>code{
    [Inject]
    Blazorise.Localization.ITextLocalizerService LocalizationService { <span class="keyword">get</span>; <span class="keyword">set</span>; }

    <span class="comment">// By using FileEdit as generic typeparam, Blazorise will know</span>
    <span class="comment">// what component need to update localization resources.</span>
    [Inject]
    Blazorise.Localization.ITextLocalizer&lt;FileEdit&gt; FileEditLocalizer { <span class="keyword">get</span>; <span class="keyword">set</span>; }

    <span class="keyword">protected</span> <span class="keyword">override</span> Task OnInitializedAsync()
    {
        FileEditLocalizer.AddLanguageResource( <span class="keyword">new</span> Blazorise.Localization.TextLocalizationResource
        {
            Culture = <span class="string">&quot;pl-PL&quot;</span>,
            Translations = <span class="keyword">new</span> Dictionary&lt;<span class="keyword">string</span>, <span class="keyword">string</span>&gt;()
{
            { <span class="string">&quot;Choose file&quot;</span>, <span class="string">&quot;Wybierz plik&quot;</span> },
            { <span class="string">&quot;Choose files&quot;</span>, <span class="string">&quot;Wybierz pliki&quot;</span> },
        }
        } );

        <span class="keyword">return</span> <span class="keyword">base</span>.OnInitializedAsync();
    }

    Task OnButtonClick()
    {
        <span class="keyword">return</span> SelectCulture( <span class="string">&quot;pl-PL&quot;</span> );
    }

    Task SelectCulture( <span class="keyword">string</span> name )
    {
        LocalizationService.ChangeLanguage( name, <span class="keyword">false</span> );

        <span class="keyword">return</span> Task.CompletedTask;
    }
}
</pre></div>
</div>
